/**
 * 
 */
package com.thor.palmmall.rest.chart.converter;

import org.springframework.core.convert.converter.Converter;

import com.thor.palmmall.rest.chart.AMonitorReport;
import com.thor.palmmall.spi.chart.SMonitorReport;

/**
 * @author NuoSa
 *
 * @since 1.0
 */
public class AMonitorReportConverter implements Converter<SMonitorReport, AMonitorReport> {

  public static AMonitorReportConverter getInstance() {
    if (instance == null)
      instance = new AMonitorReportConverter();
    return instance;
  }

  private static AMonitorReportConverter instance;

  private AMonitorReportConverter() {
  }

  @Override
  public AMonitorReport convert(SMonitorReport source) {
    if (source == null) {
      return null;
    }
    AMonitorReport target = new AMonitorReport();
    target.setCarFlows(source.getCarFlows());
    target.setPassengers(source.getPassengers());
    target.setReceiptRate(source.getReceiptRate());
    target.setSalePerArea(source.getSalePerArea());
    target.setSalesTotal(source.getSalesTotal());
    return target;
  }

}
